Skip to content

feat(staged): forward tool call raw_input params through ACP driver to DB#495

Merged
matt2e merged 2 commits intomainfrom
tool-request-params
Mar 31, 2026
Merged

feat(staged): forward tool call raw_input params through ACP driver to DB#495
matt2e merged 2 commits intomainfrom
tool-request-params

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented Mar 26, 2026

Summary

  • Extends MessageWriter trait methods (record_tool_call, update_tool_call_title) to accept an optional raw_input parameter containing the tool call's input JSON
  • Forwards raw_input from ACP session updates through the notification handler to the writer
  • Stores tool call content as structured JSON {"name": title, "input": raw_input} when raw_input is present, enabling the frontend to display detailed tool call parameters

Test plan

  • Existing tests updated to pass None for raw_input and continue to pass
  • Verify tool calls with raw_input are stored as JSON in the DB
  • Verify tool calls without raw_input fall back to plain title string

🤖 Generated with Claude Code

@matt2e matt2e requested review from baxen and wesbillman as code owners March 26, 2026 08:54
@matt2e matt2e marked this pull request as draft March 26, 2026 09:16
Plumb raw_input from ACP ToolCall/ToolCallUpdate through the full
pipeline (LiveAction enum, MessageWriter trait, DB writer) so tool calls
are stored as JSON {"name", "input"} when raw_input is present.

Handle raw_input-only ToolCallUpdate messages that previously were
silently dropped when no title was present, by caching the last-known
title per tool-call row.

Improve formatToolDisplay to extract just the tool name from ACP titles,
show only the primary arg per tool type, and fall through to plain-text
for unrecognized tool names to avoid duplicated content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matt2e matt2e force-pushed the tool-request-params branch from f5b1ab9 to d625274 Compare March 31, 2026 05:18
Address code review feedback: add Edit tool to TOOL_VERBS and
primaryArg so it shows file_path like other file-based tools, and
truncate formatArgs output at 200 chars in the default case to prevent
very long detail strings from tools with large inputs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matt2e matt2e marked this pull request as ready for review March 31, 2026 23:01
@matt2e matt2e merged commit 6cb674a into main Mar 31, 2026
6 checks passed
@matt2e matt2e deleted the tool-request-params branch March 31, 2026 23:01
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0adf3f2c0d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

}
None => stored_title.clone(),
};
let content = format_tool_call_content(&effective_title, raw_input);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve existing raw_input on title-only tool updates

When a tool call is first stored with raw_input, a later ToolCallUpdate that only changes title reaches this code with raw_input: None, and format_tool_call_content rewrites the DB row as plain text. That silently drops the previously persisted input JSON, so the UI loses structured parameters after a title change. This is a regression in the new raw-input flow and will appear whenever ACP emits title updates without re-sending raw_input.

Useful? React with 👍 / 👎.

Comment on lines +267 to +268
// Unrecognized tool name — fall through to treat parsed.name as plain text
content = parsed.name;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain parsed details for unknown JSON tool names

For parsed JSON tool calls whose name is not in TOOL_VERBS, this fallback discards parsed.args and treats the call as plain text. That regresses display for custom/unknown tools (for example MCP tools): instead of showing the tool name and arguments, the UI often degrades to a generic Ran/Running label with missing detail.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant